/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.io.Serializable;
/**
 * Cada Paciente consta de una Ficha que se compone de un diagnostico, fecha, id, prestacionID y el rut de la persona a la que corresponde.
 */
public class Ficha implements Serializable {
	public Ficha() {
	}
	
	private void this_setOwner(Object owner, int key) {
		if (key == orm.ORMConstants.KEY_FICHA_PRESTACION) {
			this.prestacion = (orm.Prestacion) owner;
		}
		
		else if (key == orm.ORMConstants.KEY_FICHA_PACIENTERUT) {
			this.pacienterut = (orm.Paciente) owner;
		}
	}
	
	org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
		public void setOwner(Object owner, int key) {
			this_setOwner(owner, key);
		}
		
	};
	
	private String diagnostico;
	
	private java.util.Date fecha;
	
	private int id;
	
	private orm.Prestacion prestacion;
	
	private orm.Paciente pacienterut;
	
	public void setDiagnostico(String value) {
		this.diagnostico = value;
	}
	
	public String getDiagnostico() {
		return diagnostico;
	}
	
	public void setFecha(java.util.Date value) {
		this.fecha = value;
	}
	
	public java.util.Date getFecha() {
		return fecha;
	}
	
	public void setId(int value) {
		this.id = value;
	}
	
	public int getId() {
		return id;
	}
	
	public int getORMID() {
		return getId();
	}
	
	public void setPrestacion(orm.Prestacion value) {
		if (prestacion != null) {
			prestacion.ficha.remove(this);
		}
		if (value != null) {
			value.ficha.add(this);
		}
	}
	
	public orm.Prestacion getPrestacion() {
		return prestacion;
	}
	
	/**
	 * This method is for internal use only.
	 */
	public void setORM_Prestacion(orm.Prestacion value) {
		this.prestacion = value;
	}
	
	public orm.Prestacion getORM_Prestacion() {
		return prestacion;
	}
	
	public void setPacienterut(orm.Paciente value) {
		if (pacienterut != null) {
			pacienterut.ficha.remove(this);
		}
		if (value != null) {
			value.ficha.add(this);
		}
	}
	
	public orm.Paciente getPacienterut() {
		return pacienterut;
	}
	
	/**
	 * This method is for internal use only.
	 */
	public void setORM_Pacienterut(orm.Paciente value) {
		this.pacienterut = value;
	}
	
	public orm.Paciente getORM_Pacienterut() {
		return pacienterut;
	}
	
	public String toString() {
		return String.valueOf(getId());
	}
	
}
